﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace VersionManage.Common
{
    public class SqlFactory
    {
        //数据库连接字符串(web.config来配置)，可以动态更改connectionString支持多数据库.		
        private static string connectionString = ConfigurationManager.AppSettings["ConnectionString"];
        private static string connectionStringReport = ConfigurationManager.AppSettings["ConnectionStringReport"];
        /// <summary>
        /// 水果机1.0的数据库
        /// </summary>
        private static string connectionStringFirst = ConfigurationManager.AppSettings["ConnectionStringFirst"];

        public static string GetConnectStr(ConnectionEnum enumConntr)
        {
            if (enumConntr.Equals(ConnectionEnum.ConnectionReport))
                return connectionStringReport;
            else if (enumConntr.Equals(ConnectionEnum.ConnectionFirst))
                return connectionStringFirst;
            else
                return connectionString;
        }

    }
    public enum ConnectionEnum
    {
        /// <summary>
        /// 默认连接字符窜
        /// </summary>
        ConnectionDefault = 1,
        /// <summary>
        /// 报表连接字符窜
        /// </summary>
        ConnectionReport = 2,
        /// <summary>
        /// 水果机1.0的数据库
        /// </summary>
        ConnectionFirst = 3
    }
}
